package com.slz3.business.module.systemManagement.sysMenu.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysMenu.domain.SysMenu;
import com.slz3.business.module.systemManagement.sysMenu.domain.SysMenuCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class SysMenuResAtomic {

    public Mono<ServerResponse> add_$SysMenuUpdateLock(ServerRequest req, SysMenu sysMenu) {
        return SysMenuResSafeValid.add(req, sysMenu) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.add(req, sysMenu);
    }

    public Mono<ServerResponse> delete_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.delete(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$SysMenuUpdateLock(ServerRequest req, SysMenu sysMenu) {
        return SysMenuResSafeValid.modify(req, sysMenu) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.modify(req, sysMenu);
    }

    public Mono<ServerResponse> info_$SysMenuUpdateLock(ServerRequest req) {
        return SysMenuResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.auditSubmit(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.audit(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.auditReject(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.usingEnable(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$SysMenuUpdateLock(ServerRequest req, SysMenuCondition sysMenuCondition) {
        return SysMenuResSafeValid.usingDisable(req, sysMenuCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysMenuResExecutor.usingDisable(req);
    }
}
